package com.yunji.coupon.enums;

import lombok.Getter;

/**
 * @author : peter-zhu
 * @date : 2024/11/20 17:16
 * @description : TODO
 **/
@Getter
public enum TriggerTypeEnum {
    SYSTEM(1, "系统弹窗"),
    RECEIVE(2, "领取触发");
    private final Integer code;
    private final String desc;

    TriggerTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer code) {
        TriggerTypeEnum[] values = TriggerTypeEnum.values();
        for (TriggerTypeEnum value : values) {
            if (value.getCode().equals(code)) {
                return value.getDesc();
            }
        }
        return null;
    }
}
